import itertools
import math

with open('input.txt') as file:

    numbers = [int(x) for x in file.readlines()]
   
    for ns in itertools.combinations(numbers, 3):
        if sum(ns) == 2020:
            print(math.prod(ns))
            break